# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: justforlxz <justforlxz@gmail.com>

pkgname=dwayland
pkgver=5.25.0
pkgrel=1
pkgdesc='Qt-style Client and Server library wrapper for the Wayland libraries'
arch=(loong64 x86_64)
license=(LGPL)
url="https://github.com/linuxdeepin/dwayland"
depends=(glibc gcc-libs libglvnd qt5-base qt5-wayland wayland)
makedepends=(extra-cmake-modules doxygen qt5-tools qt5-doc wayland-protocols deepin-wayland-protocols ninja)
source=("https://github.com/linuxdeepin/dwayland/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('72cc608174e9bbf0944feb1bbd492ff9631c3c8dc8b84e082be53c5da0406b60')

build() {
  cmake -G Ninja -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DBUILD_TESTING=OFF \
    -DBUILD_QCH=ON
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  sed -i 's/KF5/DWayland/' "$pkgdir"/usr/lib/cmake/DWayland/DWaylandTargets.cmake
}
